gdk: Add crossing mode and detail to focus events
authorMatthias Clasen <mclasen@redhat.com>
Wed, 6 Mar 2019 21:55:27 +0000 (16:55 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 17 Mar 2019 01:24:45 +0000 (21:24 -0400)
We want focus events more similar to crossing events.

gdk/gdkevents.c
gdk/gdkeventsprivate.h

index 3b0944d3cc4c80c5f888717410f221973409127e..55b744d4f3445c9cb42662836013014efb14efe9 100644 (file)
@@ -1980,6 +1980,11 @@ gdk_event_get_crossing_mode (const GdkEvent  *event,
       *mode = event->crossing.mode;
       return TRUE;
     }
+  else if (event->any.type == GDK_FOCUS_CHANGE)
+    {
+      *mode = event->focus_change.mode;
+      return TRUE;
+    }
 
   return FALSE;
 }
@@ -2006,6 +2011,11 @@ gdk_event_get_crossing_detail (const GdkEvent *event,
       *detail = event->crossing.detail;
       return TRUE;
     }
+  else if (event->any.type == GDK_FOCUS_CHANGE)
+    {
+      *detail = event->focus_change.detail;
+      return TRUE;
+    }
 
   return FALSE;
 }
index b81faba5895b416c692489d55b750aa1201311b2..1c6756e60af47fd993793a2ffd1fc09a9cfda023 100644 (file)
@@ -312,6 +312,8 @@ struct _GdkEventCrossing
  * @send_event: %TRUE if the event was sent explicitly.
  * @in: %TRUE if the surface has gained the keyboard focus, %FALSE if
  *   it has lost the focus.
+ * @mode: the crossing mode
+ * @detail: the kind of crossing that happened
  *
  * Describes a change of keyboard focus.
  */
@@ -319,6 +321,8 @@ struct _GdkEventFocus
 {
   GdkEventAny any;
   gint16 in;
+  GdkCrossingMode mode;
+  GdkNotifyType detail;
 };
 
 /*